#ifndef DATARECEIVEDHANDLER_H
#define DATARECEIVEDHANDLER_H

#include <QObject>

class RestaurantDataManager;

class DataReceivedHandler : public QObject
{
    Q_OBJECT

    friend class RestaurantDataManager;

protected:
    //Hide the constructor function so that this object can't be instanced
    DataReceivedHandler( RestaurantDataManager * p = 0) :
        QObject((QObject*)p),
        m_manager(p)
    { }

    virtual void processData(const QVariant & data) = 0;
    QVariant parseJsonData(const QVariant & data);
    RestaurantDataManager * m_manager;
    
};

/*
  LocationHandler which process the data to get location information
*/
class LocationHandler : public DataReceivedHandler
{
    void processData(const QVariant & data);

public:
    LocationHandler( RestaurantDataManager * p = 0) :
        DataReceivedHandler(p)
    { }
};

/*
  PlacesDataHandler which process the data to get place information
*/

class PlacesDataHandler : public DataReceivedHandler
{
    void processData(const QVariant & data);

public:
    PlacesDataHandler( RestaurantDataManager * p = 0) :
        DataReceivedHandler(p)
    { }
};

/*
  PlaceDetailsHandler which process the data to get place details information
*/

class PlaceDetailsHandler : public DataReceivedHandler
{
    void processData(const QVariant & data);

public:
    PlaceDetailsHandler( RestaurantDataManager * p = 0) :
        DataReceivedHandler(p)
    { }
};

#endif // DATARECEIVEDHANDLER_H
